package com.mxin.util.encrypt;

public class AESUtil {

    private static AES aes;

    public static AES getAES(){
        if(aes==null){
            synchronized (AESUtil.class){
                if(aes==null){
                    aes = new AES();
                }
            }
        }
        return aes;
    }

    public static String encrypt(String content) {
        return getAES().encryptByString(content);
    }

    public static String decrypt(String ciphertext_base64) {
        return getAES().decrypt(ciphertext_base64);
    }


    public static void main(String[] args) {
//        String value = "{\"account\":\"zj123\",\"password\":\"123456\"}";
//        String encrypt = encrypt(value);
//        System.out.println();
//        String data = encrypt;//"gbdvHJuln9/xI4Grzsnf6qZTOCroMSCfWCBscR0e5kanfqQsplY4/hGdoVj1Lu5y";
//        System.out.println(getAES().decrypt(data));

        String encryptStr = "8f509wCI/iO1ig0LggdNnSZT9hWCUOEkkdSsuXAJ82WZq65cg0LemMiii8kbHGcBaVNpwP0Zh3CaEBp9/0+VQ/Yklt75vHlVQq3mSV2DvoUqxgzN73jL3IZmk419uFI9ZopvXldFRdFnzgFGNvytHvfQPbjFmxI/Lga3HTyr5SKyi2KikYOtsx5huD6tnPw0FfGWB4bsZftdlm4edS9XuyU3Xdecmn4PKLIHLrmUfUGAJiDHV3dYWKZKnrNUM4F3KIVbmatEfzI7dfwVcFecTEdbs+NKydMPT2zyYhNuhR4mDMUSoM34isqecI6R+I3KxYDFJrJwG46WX79UNk17IgMakPxkrb5EkbpjwUQO4oTjDuzOqu0iALrXluoNPBl3HjPk9K8by37ek0t9YN1V0cB+iU2/gGNyDSLATTkUpN1USa9WWY3+eUoUyxKBKg/dsOTr8zCG54svGn62qM5FJambTFb8G8nlZ6+QR+0FRBq5I5wALbLQRb87aBHIUJkVxrZqvjN8yqlK8KSUUpmjtjrxCB79PcUSSgAhNlFMuTWRL4IpgLLOsj0iAXjHDQfvjG1LKU5SEVVejOqDPu0rOeORdWsiP07sCmMZAuurc12f5ViWh4TOJqIpx3MjvHSgtFsbIAtmCCBkdKP4gjAaLHX/c/kYX+MldODh/FkDQOMLaHLAd5eOx42fPIj7x3MGzBBZnXW7H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